package com.dyzx.hbb.modules.attendance.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 请假申请表
 * @TableName attendance_leave_application
 */
@TableName(value ="attendance_leave_application")
@Data
public class AttendanceLeaveApplication {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 请假类型编号
     */
    private String no;

    /**
     * 申请人ID
     */
    private Long userId;

    /**
     * 请假类型分类ID
     */
    private Long categoryId;

    /**
     * 请假类型：默认(1),1-休息，2-请假，3-病假
     */
    private Integer type;

    /**
     * 请假类型名称
     */
    private String name;

    /**
     * 开始时间（毫秒级时间戳）
     */
    private Long startTime;

    /**
     * 结束时间（毫秒级时间戳）
     */
    private Long endTime;

    /**
     * 请假天数
     */
    private Double leaveDays;

    /**
     * 请假小时数
     */
    private Double leaveHours;

    /**
     * 请假原因
     */
    private String reason;

    /**
     * 附件文件ID（多个用逗号分隔）
     */
    private String attachmentIds;

    /**
     * 审批人ID
     */
    private Long approvalUserId;

    /**
     * 审批意见
     */
    private String approvalComment;

    /**
     * 审批完成时间（毫秒级时间戳）
     */
    private Long approvalTime;

    /**
     *  是否已销假：默认(1)1-未销假，2-已销假
     */
    private Integer isReturned;

    /**
     * 销假时间（毫秒级时间戳）
     */
    private Long returnTime;

    /**
     * 销假说明
     */
    private String returnComment;

    /**
     * 申请状态：默认(1)1-待审批，2-审批中，3-已通过，4-已拒绝，5-已撤销
     */
    private Integer status;

    /**
     * 创建日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createDate;

    /**
     * 更新日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateDate;
    /**
     * 删除标记: 0-未删除, 1-已删除
     */
    private Integer deleted;

    /**
     * 操作人ID
     */
    private Long operatorId;

    /**
     * 企业ID
     */
    private Long organId;

    //returnUserId
    private Long returnUserId;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AttendanceLeaveApplication other = (AttendanceLeaveApplication) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getNo() == null ? other.getNo() == null : this.getNo().equals(other.getNo()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getLeaveDays() == null ? other.getLeaveDays() == null : this.getLeaveDays().equals(other.getLeaveDays()))
            && (this.getLeaveHours() == null ? other.getLeaveHours() == null : this.getLeaveHours().equals(other.getLeaveHours()))
            && (this.getReason() == null ? other.getReason() == null : this.getReason().equals(other.getReason()))
            && (this.getAttachmentIds() == null ? other.getAttachmentIds() == null : this.getAttachmentIds().equals(other.getAttachmentIds()))
            && (this.getApprovalUserId() == null ? other.getApprovalUserId() == null : this.getApprovalUserId().equals(other.getApprovalUserId()))
            && (this.getApprovalComment() == null ? other.getApprovalComment() == null : this.getApprovalComment().equals(other.getApprovalComment()))
            && (this.getApprovalTime() == null ? other.getApprovalTime() == null : this.getApprovalTime().equals(other.getApprovalTime()))
            && (this.getIsReturned() == null ? other.getIsReturned() == null : this.getIsReturned().equals(other.getIsReturned()))
            && (this.getReturnTime() == null ? other.getReturnTime() == null : this.getReturnTime().equals(other.getReturnTime()))
            && (this.getReturnComment() == null ? other.getReturnComment() == null : this.getReturnComment().equals(other.getReturnComment()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
                && (this.getReturnUserId() == null ? other.getReturnUserId() == null : this.getReturnUserId().equals(other.getReturnUserId()))
            && (this.getOrganId() == null ? other.getOrganId() == null : this.getOrganId().equals(other.getOrganId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getNo() == null) ? 0 : getNo().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getLeaveDays() == null) ? 0 : getLeaveDays().hashCode());
        result = prime * result + ((getLeaveHours() == null) ? 0 : getLeaveHours().hashCode());
        result = prime * result + ((getReason() == null) ? 0 : getReason().hashCode());
        result = prime * result + ((getAttachmentIds() == null) ? 0 : getAttachmentIds().hashCode());
        result = prime * result + ((getApprovalUserId() == null) ? 0 : getApprovalUserId().hashCode());
        result = prime * result + ((getApprovalComment() == null) ? 0 : getApprovalComment().hashCode());
        result = prime * result + ((getApprovalTime() == null) ? 0 : getApprovalTime().hashCode());
        result = prime * result + ((getIsReturned() == null) ? 0 : getIsReturned().hashCode());
        result = prime * result + ((getReturnTime() == null) ? 0 : getReturnTime().hashCode());
        result = prime * result + ((getReturnComment() == null) ? 0 : getReturnComment().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getReturnUserId() == null) ? 0 : getReturnUserId().hashCode());
        result = prime * result + ((getOrganId() == null) ? 0 : getOrganId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", no=").append(no);
        sb.append(", userId=").append(userId);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", type=").append(type);
        sb.append(", name=").append(name);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", leaveDays=").append(leaveDays);
        sb.append(", leaveHours=").append(leaveHours);
        sb.append(", reason=").append(reason);
        sb.append(", attachmentIds=").append(attachmentIds);
        sb.append(", approvalUserId=").append(approvalUserId);
        sb.append(", approvalComment=").append(approvalComment);
        sb.append(", approvalTime=").append(approvalTime);
        sb.append(", isReturned=").append(isReturned);
        sb.append(", returnTime=").append(returnTime);
        sb.append(", returnComment=").append(returnComment);
        sb.append(", status=").append(status);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", deleted=").append(deleted);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", returnUserId=").append(returnUserId);
        sb.append(", organId=").append(organId);
        sb.append("]");
        return sb.toString();
    }
}